package user

import (
	"context"

	"large-model-platform-backend/internal/svc"
	"large-model-platform-backend/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type RemoveChatSessionLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewRemoveChatSessionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveChatSessionLogic {
	return &RemoveChatSessionLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *RemoveChatSessionLogic) RemoveChatSession(req *types.ChatSessionReq) (resp *types.BooleanResp, err error) {
	userModel := l.svcCtx.UserModel

	_, err = userModel.DeleteChatSession(l.ctx, req)

	return &types.BooleanResp{
		Result: types.Result{Code: 200},
		Data:   true,
	}, nil
}
